TreeGrid Gantt Chart Tutorial
2. Date constraints
Task and project date constraints
-
Chart constraints
are defined for the whole chart and cannot be changed by a user.
By default the chart is exactly wide to display all objects (Main, Milestone, Flow, Run, Flags, Points and Resources) in all rows and also the GanttBase and GanttFinish.
The task Constraints objects affect the chart width only if set GanttShowConstraints='2'.
The chart is resized whenever the most left or the most right object moves inside or some object moves otuside the chart.
-
The
MaxWidth
and MinWidth
specify maximal and minimal width of the column, in pixels.
The maximal MaxWidth is limited by various browser limits, for Opera it is 23,000, for IE it is 178,957.
-
The
GanttChartMinStart
and GanttChartMaxEnd
define bounds for the whole chart,
the chart will never show outside dates (except applying column MinWidth attribute).
No Gantt object can be moved or created outside these bounds.
-
The
GanttChartMaxStart
and GanttChartMinEnd
define minimal date range for the whole chart,
the chart will always show the dates inside the range (except applying column MaxWidth attribute).
These bounds has no effect for the Gantt objects.
If MaxStart == MinStart and MinEnd == MaxEnd the chart size is fixed and it always shows the same dates (except applying MaxWidth/MinWidth).
-
The GanttChartRound rounds the first and last date shown in the chart to given units (like "y" for year, "d" for days).
The GanttLeft and GanttRight adds given count of empty GanttUnits on the chart sides.
-
Project constraints
are defined for the whole chart and can be optionally changed by a user.
The project constraints can be hidden, but still used when set GanttShowBounds='0'.
-
GanttBase
defines the project baseline.
On the baseline should start all tasks without incoming dependencies, if set GanttStrict='1' and the dependencies are corrected, auto or manually.
If the baseline is not set or it is deleted, the (thin) baseline is displayed on start date of the most left task in the chart, but does not affect anything.
No gantt object can be moved or create before baseline if set GanttBaseProof='1'.
The baseline can be changed by mouse dragging if set GanttBaseCanEdit='1'.
The baseline can be read and changed also by API by methods GetGanttBase and SetGanttBase, usually for let users to edit it in some cell.
The baseline is uploaded to server in <Gantt> XML tag when set Upload_Type='Gantt'.
-
GanttFinish
defines the project finish date.
The project finish is mostly used to calculate critical path, by calculating GanttSlack value for every task.
The critical tasks have zero (or small) value of the slack.
If the project finish is not set or it is deleted, the project finish is set to end date of the most right task in the chart,
it is displayed as thin line and is still used for critical path calculation.
No gantt object can be moved or create after project finish if set GanttFinishProof='1'.
The project finish can be changed by mouse dragging if set GanttFinishCanEdit='1'.
The project finish can be read and changed also by API by methods GetGanttFinish and SetGanttFinish, usually for let users to edit it in some cell.
The project finish is uploaded to server in <Gantt> XML tag when set Upload_Type='Gantt'.
If set GanttLastUnit, the GanttFinish is used and shown one GanttLastUnit higher (as the ending date of the period).
-
Task constraints
are defined individually for every task.
The task constraints are shown in chart as icons, or can be hidden if set GanttShowConstraints='0'.
The constraints can affect moving tasks while correcting dependencies, creating, moving or resizing task by a user
and creating, moving or resizing other Gantt object, the functions are specified by GanttUseConstraints.
The constraints can be created, moved and deleted by a user if GanttEdit contains "Constraints" keyword.
If set GanttLastUnit, the ending constraints are used and shown one GanttLastUnit higher (as the ending date of the period).
-
GanttMinStart
is early start constraint, the task cannot start before this date.
With GanttMaxStart on the same date it creates mandatory start constraint, the task must start on this date.
-
GanttMaxStart
is late start constraint, the task cannot start after this date.
It is used only for main bar, not for other Gantt objects like flow or milestone.
-
GanttMinEnd
is early end constraint, the task cannot finish before this date.
It is used only for main bar, not for other Gantt objects like flow or milestone.
-
GanttMaxEnd
is late start constraint, the task cannot finish after this date.
With GanttMinEnd on the same date it creates mandatory end constraint, the task must finish on this date.